package com.td.erhome.ui.min;

import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.td.erhome.R;
import com.td.erhome.base.BaseActivity;
import com.td.erhome.utils.DialogUtils;
import com.td.erhome.utils.UserManager;

import butterknife.Bind;
import butterknife.OnClick;

public class InviteFriendActivity extends BaseActivity {


    @Bind(R.id.img_back)
    ImageView mImgBack;
    @Bind(R.id.re_title)
    RelativeLayout mReTitle;
    @Bind(R.id.tv_num)
    TextView mTvNum;
    @Bind(R.id.tv_sure)
    TextView mTvSure;
    @Bind(R.id.tv_invit)
    TextView mTvInvit;
    private DialogUtils mDialogUtils;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_invite_friend;
    }

    @Override
    protected void initView() {
        mDialogUtils = new DialogUtils();
        mTvNum.setText(UserManager.getIns().getUser().invite_count);
        mTvInvit.setText("邀请码: "+UserManager.getIns().getUser().invite_code);

    }

    @Override
    protected void releaseResource() {
        mDialogUtils= null;
    }


    @OnClick({R.id.img_back, R.id.tv_sure})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.img_back:
                finish();
                break;
            case R.id.tv_sure:
                mDialogUtils.createTopUp(this,mTvSure,"邀请好友，送抵用券",UserManager.getIns().getUser().invite_url,"快来参与吧");
                break;
        }
    }

}
